Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Enable to Disable Language Toggle in Site Header #1633

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jamesnulliu
Copy link

What does this PR change? What problem does it solve?

This PR modifies "layouts/partials/header.html" by adding site.Params.disableLangToggle to disable language switch toggle if set to true. (I think sometimes users may just want to provide translation functionality in blogs instead of the whole site 🤔)

For example, if set params.disableLangToggle to false in "hugo.yaml/toml/...", everything stays the same:

image

If set to true, then the language switch toggle will not appear, but the one in blogs will still available:

image

Was the change discussed in an issue or in the Discussions before?

This change is not discussed in an issue before, but is a simple yet lovely enhancement.

PR Checklist

  • This change adds/updates translations and I have used the template present here.
  • I have enabled maintainer edits for this PR.
  • I have verified that the code works as described/as intended.
  • This change adds a Social Icon which has a permissive license to use it.
  • This change does not include any CDN resources/links.
  • This change does not include any unrelated scripts such as bash and python scripts.
  • This change updates the overridden internal templates from HUGO's repository.

Add `site.Params.disableLangToggle` to disable language switch toggle if set to true.
@jamesnulliu jamesnulliu changed the title Update header.html [FEATHER] Enable to Disable Language Toggle in Site Header Nov 21, 2024
@jamesnulliu jamesnulliu changed the title [FEATHER] Enable to Disable Language Toggle in Site Header [FEATURE] Enable to Disable Language Toggle in Site Header Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant